using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for MessageBox
/// </summary>
/// 
namespace Evaluation3.utils
{
    public class MessageBox
    {
        public static int INFO = 1;
        public static int WARING = 2;
        public static int CONFIRM = 3;
        public static int ERROR = 4;
        public static String CONFIRM_FUNCTION = "CONFIRM()";
        private static int messageType = 1;
        private static bool yes = false;
        public MessageBox()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public static int MESSAGE_TYPE {
            set { messageType = value; }
            get { return messageType; }
        }
        public static bool ANSWER {
            set { yes = value; }
            get { return yes; }
        }
        public static String SHOW(String message, int type)
        {
            messageType = type;
            String Script = "" ;
            if (type == INFO)
            {
                Script = "<script language='javaScript' type ='text/javascript'> ";
                Script = Script + "alert('" + message + "')";
                Script = Script + "</script>";
                 
            } else if (type == CONFIRM) {
                Script = "<script language='javaScript' type ='text/javascript'> ";
                Script = Script + "function CONFIRM(){ ";
                Script = Script + "return confirm("+message+");";
                Script = Script + "}";                   
                Script = Script + "</script>";
                
            }
            return Script;
        }
    }
}
